/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.tchepannou.rails.engine.container;

import com.tchepannou.rails.core.api.ContainerContext;
import com.tchepannou.rails.core.api.MailController;
import java.io.IOException;
import java.util.Map;
import javax.mail.MessagingException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Default implementation of {@link ActionControllerProvider}.
 *
 * @author herve
 */
public class MailControllerContainer
{
    //-- Static Attribute
    private static final Logger LOG = LoggerFactory.getLogger (MailControllerContainer.class);
    
    
    //-- Attribute
    private MailControllerWrapper _wrapper = new MailControllerWrapper ();
    
    //-- Constructeur
    public MailControllerContainer ()
    {
    }


    //-- Public method
    public void init (ContainerContext containerContext)
    {
        LOG.info ("Initializing");

        _wrapper.init (containerContext);

        LOG.info ("Initialized");
    }

    public void destroy ()
    {
        LOG.info ("Destroying");

        _wrapper.destroy ();

        LOG.info ("Destroyed");
    }

    public void deliver (String action, Map data, MailController controller)
        throws MessagingException, IOException
    {
        _wrapper.deliver (action, data, controller);
    }
}
